package com.sqbr.video.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import com.sqbr.video.core.response.R;
import com.sqbr.video.service.ICaptchaService;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
@Api(value = "验证码接口")

@RestController
@RequestMapping("/captcha")
@RequiredArgsConstructor
public class CaptchaController {

    private final ICaptchaService captchaService;
    /**
     * 图形验证码
     * @return
     */
    @GetMapping("/image")
    @SaIgnore
    public R<HashMap<String,String>> defaultCaptChaImage() {
        HashMap<String,String> code= captchaService.defaultCaptChaImage();
        return R.data(code);

    }

}
